<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link rel="stylesheet" type="text/css" href="${resources}/css/login.css" />
<head>
<title>登陆</title>
<script src="${resources}/js/jquery.js"></script>
<script src="${resources}/plugins/jquery-cookie/1.3.1/jquery.cookie.min.js"></script>
<link rel="shortcut icon" href="${resources}/icon/favicon.ico"type="image/x-icon" />
<link rel="icon" href="${resources}/icon/favicon.ico"type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
	<!-- top begin -->
	<div class="w">
		<div id="logo">
			<a href="${path}"> <img
				src="${resources}/images/logo_white.png" alt="么嘛哒" width="170"
				height="60">
			</a> <b></b>
		</div>
	</div>
	<!-- top end -->

	<div id="content">
		<div class="login-wrap">
			<div class="w">
				<div class="login-form">
					<div class="login-box">
						<div class="mt">
							<h1>淘惠邦会员</h1>
							<div class="extra-r">
								<div class="regist-link">
									<a href="${path}/reg" target="_blank"> <b><i
											class="fa fa-chevron-circle-right"></i></b>立即注册
									</a>
								</div>
							</div>
						</div>

						<div class="msg-wrap">
							<div class="msg-warn">
							    <c:if test="${msg!=null}"><b><i class="fa fa-lightbulb-o"></i></b>${msg}</c:if>
								<c:if test="${msg==null}"><b><i class="fa fa-lightbulb-o"></i></b>公共场所不建议自动登录，以防账号丢失</c:if>
							</div>
						</div>

						<div class="mc">
							<div class="form">
								<form id="validation-form" action="${path}/login" method="post">
									<div class="item item-fore1">
										<label for="loginname" class="login-label name-label">
											<i class="fa fa-user"></i>
										</label> <input id="username" type="text" class="itxt" name="username"
											tabindex="1" autocomplete="off" value=""
											placeholder="邮箱/用户名/已验证手机"> <span class="clear-btn"
											style="display: inline;"></span>
									</div>

									<div id="entry" class="item item-fore2">
										<label class="login-label pwd-label" for="nloginpwd">
											<i class="fa fa-lock"></i>
										</label> <input type="password" id="password" name="password"
											class="itxt itxt-error" tabindex="2" autocomplete="off"
											placeholder="密码">
									</div>

									<div class="item item-fore3">
										<div class="safe">
											<span> <input id="rememberMe" name="rememberMe"
												value="true" type="checkbox" class="jdcheckbox" tabindex="3">
												<label for="">记住密码</label>
											</span> <span class="forget-pw-safe"> <a
												href="${path}/backPwd" class="">忘记密码?</a>
											</span>
										</div>
									</div>

									<div class="item item-fore5">
										<div class="login-btn">
											<a href="javascript:;" class="btn-img btn-entry"
												id="loginsubmit" tabindex="6"
												clstag="pageclick|keycount|20150112ABD|2">登&nbsp;&nbsp;&nbsp;&nbsp;录</a>
										</div>
									</div>

								</form>
							</div>
						</div>

					</div>
				</div>

				<!-- login-banner begin -->
				<div class="login-banner" style="background-color: #1d90bf">
					<div class="w">
						<div id="banner-bg" class="i-inner"
							style="background: url(${resources}/images/login_banner.jpg) 0px 0px no-repeat;background-color: #1d90bf">
						</div>
					</div>
				</div>
				<!-- login-banner end -->

			</div>
		</div>
	</div>

	<!-- foot begin -->
	<div class="w">
		<div id="footer-2013">
			<div class="links">
				<a rel="nofollow" target="_blank" href="#"> 关于我们 </a> | <a
					rel="nofollow" target="_blank" href="#"> 联系我们 </a> | <a
					rel="nofollow" target="_blank" href="#"> 人才招聘 </a> | <a
					rel="nofollow" target="_blank" href="#"> 商家入驻 </a> | <a
					rel="nofollow" target="_blank" href="#"> 广告服务 </a> | <a
					rel="nofollow" target="_blank" href="#"> 手机么马达 </a> | <a
					target="_blank" href="#"> 友情链接 </a> | <a target="_blank" href=#">
					销售联盟 </a>

			</div>
			<div class="copyright">
				Copyright©2015-2016&nbsp;&nbsp;么嘛哒&nbsp;版权所有</div>
		</div>
	</div>
	<!-- foot end --> 
</body>
<script type="text/javascript">

$(document).ready(
 		function() {  
	        
 			
 			if ($.cookie("rememberMe") == "true") {
		        $("#rememberMe").attr("checked", true);
		        $("#username").val($.cookie("username"));
		        $("#password").val($.cookie("password"));
		    }
 			
 			
 			//登陆
 			$("#loginsubmit").click(function(){ 
 				submit();
 			});
 			
 			document.onkeydown=function(event){        
 				var e = event || window.event || arguments.callee.caller.arguments[0];      
 				if(e && e.keyCode==13){ // enter 键            
 					 submit();
 					}      
 				}; 
 				
 				
			function submit(){
				var rememberMe = $("#rememberMe");
	    	 	if (rememberMe[0].checked == true) {
			        var username = $("#username").val();
			        var password = $("#password").val();
			        $.cookie("rememberMe", "true", { expires: 7 , path: '/' }); // 存储一个带7天期限的 cookie
			        $.cookie("username", username, { expires: 7 , path: '/' }); // 存储一个带7天期限的 cookie
			        $.cookie("password", password, { expires: 7 , path: '/' }); // 存储一个带7天期限的 cookie
			    }
			    else {
			        $.cookie("rememberMe", "false", { expires: -1 });
			        $.cookie("username", '', { expires: -1 });
			        $.cookie("password", '', { expires: -1 });
			    }
				    
				$("#validation-form").submit();
				
			}
	 
 		});
</script>
</html>
